<template>
	<view>
		<u-subsection :list="list" fontSize="12px" mode="subsection" inactiveColor="#4d95ff" :current="current"
			@change="sectionChange"></u-subsection>
	</view>
</template>

<script>
	// import {
	// 	city
	// } from "@/utils/initMap.js"
	import {
		toast
	} from '@/utils/common'
	export default {
		name: "MyTabbar",
		data() {
			return {
				list: ['地图', '列表'],
				current: 0
			};
		},
		props: ['chengCurrent'],
		watch: {
			chengCurrent: {
				handler(newVal, oldVal) {
					this.current = 0
				},
				deep: true, //true 深度监听
			}
		},
		methods: {
			sectionChange(index) {
				this.current = index;
				this.$emit('sectionChange', index);
			}
		}
	}
</script>

<style lang="scss">
	::v-deep .u-subsection {
		background: #fff;
	}
</style>